/*
 * @Author: 刘凯欣
 * @Date: 2025-11-06 10:17:55
 * @LastEditors: 刘凯欣
 * @LastEditTime: 2025-11-07 10:22:04
 * @Description: 
 */
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');

var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');

var adminRouter = require('./routes/admin/articles');

var app = express();

app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

app.use('/', indexRouter);
app.use('/users', usersRouter);
app.use('/admin/articles',adminRouter)

module.exports = app;
